<template>
    <a-result status="404" title="404" sub-title="Sorry, the page you visited does not exist.">
        <template #extra>
            <a-button type="primary" @click="back">回到首页</a-button>
        </template>
    </a-result>
</template>

<script lang="ts" setup>
    const $router = useRouter();
    const back = () => {
        if (window.history.length) {
            $router.go(-1);
        } else {
            $router.replace("/");
        }
    };
</script>

<style scoped lang="scss"></style>
